/**
 * 
 */
package cn.ipenta.jkb.web;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.ipenta.jkb.JkbWebException;
import cn.ipenta.jkb.entity.TxInfo;
import cn.ipenta.jkb.service.RegulatorService;
import cn.ipenta.jkb.utils.JsonMapper;
import cn.ipenta.jkb.web.vo.PayVo;
import net.sf.cglib.beans.BeanCopier;

/**
 * @ClassName: HealerController
 * @Description: TODO
 * @author ipenta
 * @date 2017年4月16日 下午9:55:16
 * 
 */
@Controller
public class RegulatorController {

	final BeanCopier copier = BeanCopier.create(PayVo.class, TxInfo.class, false);

	@Autowired
	RegulatorService regulatorService;

	@GetMapping("/api/regulator/apply/list")
	public @ResponseBody Map<String, Object> findApplyList(@RequestParam String id) throws JkbWebException {
		List<TxInfo> txInfos = regulatorService.findApplyRecordById(id);
		return JsonMapper.success(txInfos);
	}

	@GetMapping("/api/regulator/pay/list")
	public @ResponseBody Map<String, Object> findPayList(@RequestParam String id) throws JkbWebException {
		List<TxInfo> txInfos = regulatorService.findPayRecordById(id);
		return JsonMapper.success(txInfos);
	}

}
